package com.KKd.service;

import com.KKd.mapper.BlogMapper;
import com.KKd.pojo.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author 14587
 * @date 2020/11/10 19:40
 */
@Service
public class BlogServiceImpl implements BlogService{
    @Autowired
    private BlogMapper blogMapper;

    public void setBlogMapper(BlogMapper blogMapper) {
        this.blogMapper = blogMapper;
    }

    public int addBlog(Blog blog) {
        return blogMapper.addBlog(blog);
    }

    public int deleteBlogById(int blogId) {
        return blogMapper.deleteBlogById(blogId);
    }

    public int updateBlog(Blog blog) {
        return blogMapper.updateBlog(blog);
    }

    public Blog queryBlog(Map map) {
        return blogMapper.queryBlog(map);
    }

    public List<String> queryBlogLike(String title) {
        return blogMapper.queryBlogLike(title);
    }

    public List<Blog> queryBlogTitleContent() {
        return blogMapper.queryBlogTitleContent();
    }

    public List<Blog> queryBlogExceptText() {
        return blogMapper.queryBlogExceptText();
    }

    public int addBlobThumbNum(int blogId) {
        return blogMapper.addBlobThumbNum(blogId);
    }

    public int addBlogViewCount(String title) {
        return blogMapper.addBlogViewCount(title);
    }

    public int queryThumbs(int blogId) {
        return blogMapper.queryThumbs(blogId);
    }
}
